//
//  Video.m
//  001--XML解析
//
//  Created by H on 16/8/16.
//  Copyright © 2016年 TanZhou. All rights reserved.
//

#import "Video.h"

@implementation Video

-(NSString *)time
{
    int len = self.length.intValue;
    return  [NSString stringWithFormat:@"%02d:%02d:%02d",len/3600,(len % 3600)/60,(len%60)];
}


-(instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}


+(instancetype)VideoWithDict:(NSDictionary *)dict
{
    return [[self alloc]initWithDict:dict];
}


-(NSString *)description
{
    return [NSString stringWithFormat:@"<%@ : %p>{ videoId : %@, name : %@ ,length : %@ , videoURL : %@ ,imageURL : %@ , desc : %@ , teacher : %@ , time : %@}",[self class],self,self.videoId,self.name,self.length,self.videoURL,self.imageURL,self.desc,self.teacher,self.time];
}

@end
